﻿package net.jmp0.toast.entities.menu 
{
	import flash.geom.ColorTransform;
	import net.jmp0.toast.entities.bases.GameButton;
	import net.jmp0.toast.entities.effects.GameText;
	import punk.core.Spritemap;
	
	/**
	 * ...
	 * @author Thodd
	 */
	public class UpButton extends GameButton
	{
		//The marker
		[Embed(source = '../../res/marker/marker_small_green.png')] private var imgMarker:Class;
		private var sprMarker:Spritemap = FP.getSprite(imgMarker, 82, 45, false, false, 4, 3, false);
		
		//button text
		private var buttonText:GameText;
		
		public function UpButton(x:int, y:int, callback:Function){
			super(x, y, callback);
			
			this.sprite = sprMarker;
			
			var colorT:ColorTransform = new ColorTransform();
			colorT.alphaMultiplier = 0.7;
			sprMarker.colorTransform(sprMarker.rect, colorT);
			
			buttonText = new GameText("+", x + 10, y - 40, "garbage", 100, -351, true);
			
		}
		
		
		override public function update():void {
			super.update();
			
			if (mouseIsOverMe) {
				visible = true;
			}else {
				visible = false;
			}

		}
		
		override public function destroy():void {
			buttonText.destroy();
			super.destroy();
		}
		
	}

}